package cn.iocoder.yudao.module.yyzx.dal.mysql.retreat;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.yyzx.dal.dataobject.retreat.RetreatDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.yyzx.controller.admin.retreat.vo.*;

/**
 * 退住登记 Mapper
 *
 * @author jzh
 */
@Mapper
public interface RetreatMapper extends BaseMapperX<RetreatDO> {

    default PageResult<RetreatDO> selectPage(RetreatPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RetreatDO>()
                .eqIfPresent(RetreatDO::getCustomerid, reqVO.getCustomerid())
                .betweenIfPresent(RetreatDO::getRetreatTime, reqVO.getRetreatTime())
                .eqIfPresent(RetreatDO::getRetreatType, reqVO.getRetreatType())
                .eqIfPresent(RetreatDO::getRetreatReason, reqVO.getRetreatReason())
                .eqIfPresent(RetreatDO::getStatus, reqVO.getStatus())
                .eqIfPresent(RetreatDO::getAuditStatus, reqVO.getAuditStatus())
                .eqIfPresent(RetreatDO::getAuditPerson, reqVO.getAuditPerson())
                .eqIfPresent(RetreatDO::getAuditTine, reqVO.getAuditTine())
                .betweenIfPresent(RetreatDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RetreatDO::getId));
    }

}